import { InjectionToken } from '@angular/core';

/** 根据运行环境设置不同的环境变量 */
export class ApplicationEnv {

  constructor(
    /** 前端接口地址统一前缀路径 */
    public apiPath?: string,
    /** session失效或者无效时跳转到授权页面 */
    public authUrl?: string,
    /** 当前是否在生产环境运行 */
    public production?: boolean,
    /** 前端监控服务，数据上报的地址 */
    public reportUrl?: string,
    /** gaTrackingId */
    public gaTrackingId?: any,
  ) { }
}

export const BASE_DICT_URL = new InjectionToken<string>('base dict url');

export const STORE_PREFIX = new InjectionToken<string>('store prefix');

export const STORE_VERSION = new InjectionToken<string>('store version');

export const DICT_BASE_STORAGE_NAME = new InjectionToken<string>('dict base storage name');

export const GLOBAL_I18N = new InjectionToken<string>('global i18n');

export const LOCAL_DICT = new InjectionToken<string>('local dict');

/** 是否开启路由复用，同时会显示tab页签 */
export const ROUTE_REUSE = new InjectionToken<string>('route reuse');
/**
 * 校验页面session是否有效的白名单，在该名单中的页面一律不需要校验，内容为正则表达式，
 * 同时在该页面中发出请求时发现会话失效一律不显示弹框提醒，直接跳转到认证页面
 */
export const SESSION_CHECK_WHITELIST_PAGES = new InjectionToken<string>('session white pages');

/** 会话过期时间 */
export const SESSION_EXPIRY_TIME = new InjectionToken<string>('session expiry time');

export const MATH_SCRIPT_PATHS = new InjectionToken<string>('math script paths');

export const NAV_TAB_MAX_CACHE = new InjectionToken<number>('nav tab max cache');

export const NAV_TAB_DISPLAY_MAX_COUNT = new InjectionToken<number>('nav tab display max count');

export const NAV_TAB_DISABLE_LOAD = new InjectionToken<boolean>('nav tab disable load');

export const VIEW_HEADER_FIXED = new InjectionToken<boolean>('view header fixed');

export const DISABLED_INIT_LOAD_STORE_KEY = new InjectionToken<string[]>('disabled init load store key');

export const LOGGER_REWRITE_NATIVE_METHOD = new InjectionToken<boolean>('logger rewrite native method');

export const CLIPBOARD_SCRIPT_PATHS = new InjectionToken<string[]>('clipboard script paths');

export const RESOURCE_URL = new InjectionToken<string>('resource url');

export const SPA = new InjectionToken<boolean>('is spa mode');

export const SAAS_PRODUCT_ACL = new InjectionToken<boolean>('saas product acl');
